package com.es.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

/**
 * 描述:
 * es-meta-
 *
 * @author Derek
 * @create 2021-11-29 9:51
 */
@Controller
@RequestMapping("/user")
public class LoginController {

    @RequestMapping("/login")
    public String login(String username, String password, HttpSession session){
        if("admin".equals(username) && "admin".equals(password)){
            //
            session.setAttribute("currentUser", username);
            return "loginSuccess";
        }else{
            return "redirect:/login.jsp";
        }

    }
}
